package com.itheima.exception;


import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Component
@ControllerAdvice
public class ExceptionAnnocation {

    @ExceptionHandler(Exception.class)
    public void test01(Exception ex){
        System.out.println("hhh");
    }

    @ExceptionHandler(SystemException.class)
    public void test01(SystemException ex){
        System.out.println("hhh1111");
    }
}
